export default {
  props: {
    value: String,
    options: Object
  },
  render(h) {
    var options = Object.assign(
      {
        fit: 'contain',
        defaultIcon: 'em-icon-shape-sns-chat-error'
      },
      this.options
    )
    const { fit, defaultIcon } = options
    return h('el-image', {
      props: {
        src: this.value,
        fit: fit
      },
      scopedSlots: {
        error: () => {
          return h('em-icon', {
            props: {
              name: defaultIcon
            }
          })
        }
      }
    })
  }
}
